import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBApplication.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBNavigator.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';

class YBMiShuTongShangJiKuSubPage extends StatelessWidget {

  final String contentStr;
  final String addressStr;
  final String shengYuStr;
  final String timeStr;
  final String sysCode;
  final String requestCode;
  final int type;

  const YBMiShuTongShangJiKuSubPage({Key key, this.contentStr, this.addressStr, this.shengYuStr, this.timeStr,this.sysCode,this.requestCode,this.type}) : super(key: key);

  @override
  Widget build(BuildContext context) {

    bool shengYuIsDisplay = false;

    if (int.parse(shengYuStr) == 10000) {
       shengYuIsDisplay = true;
    }else{
       shengYuIsDisplay = false;
    }


    return Container(
      child: InkWell(
        child: Container(
          color: YBColor.white,
          child: Column(
            children: [
              Container(
                child: Padding(
                  padding: EdgeInsets.only(left:YBTextStyle.adapterSize20,right: YBTextStyle.adapterSize20),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.stretch,
                    children: [
                      Container(
                        height: YBTextStyle.adapterSize16,
                      ),
                      Container(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: [
                            Container(
                              child: Text(
                                contentStr??'',
                                maxLines: 1,
                                style: YBTextStyle.TextStyle1B1C1F18Medium,
                              ),
                            ),
                            Container(
                              child: shengYuIsDisplay?Container():Container(
                                child: Text(
                                  '还剩$shengYuStr次获取机会'??"",
                                  style: YBTextStyle.TextStyle6E737A13,
                                ),
                              ),
                            ),
                          ],
                        ),
                      ),

                      Container(
                        height: YBTextStyle.adapterSize12,
                      ),
                      Container(
                        child: Text(
                          addressStr??"",
                          style: YBTextStyle.TextStyle6E737A14,
                        ),
                      ),
                      Container(
                        height: YBTextStyle.adapterSize12,
                      ),
                      Container(
                        height: 0.5,
                        color: YBColor.colorF5F5F7,
                      ),
                      Container(
                        height: YBTextStyle.adapterSize13,
                      ),
                      Container(
                        child: Text(
                          timeStr??"",
                          style: YBTextStyle.TextStyle71747A12,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              Container(
                height: YBTextStyle.adapterSize13,
              ),
              Container(
                height: YBTextStyle.adapterSize5,
                color: YBColor.colorF5F5F7,
              ),
            ],
          ),
        ),
        onTap: (){
          YBNavigatorUtil.jump(context, '/workTaiPage/workTaiMiShuTongPage/workTaiMiShuTongShangJikuPage/workTaiMiShuTongGongYongDetailPage?syscode=$sysCode&requestcode=$requestCode&type=$type');
        },
      ),
    );
  }
}
